//
//  UILabel+LXAdd.h
//  LXLabelDemo
//
//  Created by 刘鑫 on 16/4/13.
//  Copyright © 2016年 liuxin. All rights reserved.
//

/*******************
 字间距
 行间距
 设置下划线
 设置关键字
 自适应宽高
 ****************/

#import <UIKit/UIKit.h>

@interface UILabel (LXAdd)
/**
 *  字间距
 */
@property (nonatomic,assign)CGFloat characterSpace;

/**
 *  行间距
 */
@property (nonatomic,assign)CGFloat lineSpace;

/**
 *  关键字
 */
@property (nonatomic,copy  )NSString *keywords;
@property (nonatomic,strong)UIFont   *keywordsFont;
@property (nonatomic,strong)UIColor  *keywordsColor;

/**
 *  下划线
 */
@property (nonatomic,copy  )NSString *underlineStr;
@property (nonatomic,strong)UIColor  *underlineColor;


/**
 *  text的width
 */
@property (nonatomic,assign)CGFloat lableWidth;
/**
 *  计算label宽高，必须调用
 *
 *  @param maxWidth 最大宽度
 *
 *  @return label的size
 */
- (CGSize)getLableSizeWithMaxWidth:(CGFloat)maxWidth;

+(instancetype)initWithFont:(CGFloat)font textColor:(NSString *)color text:(NSString *)text;

@end

@interface UILabel (FormattedText)

- (void)setTextColor:(UIColor *)textColor range:(NSRange)range;
- (void)setFont:(UIFont *)font range:(NSRange)range;
@end
